﻿using Admin.Application.Dto;
using Admin.Database.Model;
using Framework.SqlSugar.Entity;
using Framework.SqlSugar.Utils;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml;

namespace Admin.Application.DynamicApi.System.User.Dto
{
	/// <summary>
	/// 设置用户状态输入参数
	/// </summary>
	public class UserInput : BaseStatusInput
	{
	}

	/// <summary>
	/// 获取用户分页列表输入参数
	/// </summary>
	public class PageUserInput : BasePageInput
	{
		/// <summary>
		/// 账号
		/// </summary>
		public string? Account { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		public string? Name { get; set; }

		/// <summary>
		/// 查询时所选机构Id
		/// </summary>
		public long OrgId { get; set; }
	}

	/// <summary>
	/// 增加用户输入参数
	/// </summary>
	public class AddUserInput : EntityBaseId
	{
		/// <summary>
		/// 账号
		/// </summary>
		[Required(ErrorMessage = "账号不能为空")]
		public string Account { get; set; }

		/// <summary>
		/// 姓名
		/// </summary>
		[Required(ErrorMessage = "真实姓名不能为空")]
		public string Name { get; set; }

		/// <summary>
		/// 所选机构Id
		/// </summary>
		[Required(ErrorMessage = "所选机构不能为空")]
		public long OrgId { get; set; }

		/// <summary>
		/// 角色集合
		/// </summary>
		public List<long> RoleIdList { get; set; }

		/// <summary>
		/// 扩展机构集合
		/// </summary>
		public List<SysUserExtOrg> ExtOrgIdList { get; set; }
	}

	/// <summary>
	/// 更新用户输入参数
	/// </summary>
	public class UpdateUserInput : AddUserInput
	{
	}

	/// <summary>
	/// 删除用户输入参数
	/// </summary>
	public class DeleteUserInput
	{
		/// <summary>
		/// 主键Id
		/// </summary>
		[Required(ErrorMessage = "Id不能为空")]
		public virtual long Id { get; set; }

		/// <summary>
		/// 机构Id
		/// </summary>
		public long OrgId { get; set; }
	}

	/// <summary>
	/// 重置用户密码输入参数
	/// </summary>
	public class ResetPwdUserInput : BaseIdInput
	{
	}

	/// <summary>
	/// 修改用户密码输入参数
	/// </summary>
	public class ChangePwdInput
	{
		/// <summary>
		/// 当前密码
		/// </summary>
		[Required(ErrorMessage = "当前密码不能为空")]
		public string PasswordOld { get; set; }

		/// <summary>
		/// 新密码
		/// </summary>
		[Required(ErrorMessage = "新密码不能为空"), MinLength(5, ErrorMessage = "密码需要大于5个字符")]
		public string PasswordNew { get; set; }
	}

}
